<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
if($_RQ['op']=='get'){
	$return['set']=$this->plugin_setting('setting');
	if($_SESSION['os']=='windows'){
		$return['session_id']=session_id();
	}
	//if($_SESSION['uid']){
	//	exi('','error','jy_tour/merch.index/');
	//}
	$_SESSION['logout_forward']='jy_gohome/merch.login/';
	$return['info']['forward']='jy_gohome/merch.index/'; 
	exi($return);
}
if($_RQ['op']=='post'){
	$post=get_postdata();
	if(!$post['username'] || !$post['pwd']){
		exi('请输入用户名和密码!','error');
	}
	$user=pdo_get('jy_gohome_merch',array('uniacid'=>$_SESSION['uniacid'],'uname'=>$post['username']));
	if(!$user || $post['password']!=base64_decode($user['upass'])){
		exi('用户名或密码错误!','error');
	}
	$_SESSION['uid']=$user['id'];
	$_SESSION['merchid']=$user['id'];
	$_SESSION['member']['username']=$user['uname'];
	$url=custom_url('jy_gohome/merch.index/',true);
	exi('登陆成功','',$url);
	
}